<template>
  <a-button type="primary" @click="sequenceDownload()"
    >登&nbsp;&nbsp; 录</a-button
  >
</template>
<script>
import { defineComponent } from "vue";
export default defineComponent({
  setup() {
    var data = {
      message: [
        "javascript-1",
        "javascript-2",
        "javascript-3",
        "javascript-4",
        "javascript-5",
      ],
    };
    const sequenceDownload = (row) => {
      var element = document.createElement("a");
      var message = "";
      for (var i = 0; i < data.message.length; i++) {
        message += data.message[i] + "\n";
      }
      element.setAttribute(
        "href",
        "data:text/plain;charset=utf-8," + encodeURIComponent(message)
      );
      element.setAttribute("download", "注册信息-" + new Date().getTime());
      element.style.display = "none";
      document.body.appendChild(element);
      element.click();
      document.body.removeChild(element);
    };
    return {
      data,
      sequenceDownload,
    };
  },
});
</script>
<style>
</style>